/* Output Pixel Format Define */
#ifndef _OUTPUT_SAIL_
#define _OUTPUT_SAIL_

//#include <stdio.h>

#include "sail.h"
#include "misc.h"

#define RGB16     90
#define RGB24	  91
#define RGB32	  92
#define YUV		  93

#define FR10		  100
#define FR15		  115
#define FR20		  120
#define FR25		  125
#define FR30		  130

extern int FrameRate;

class C_Output_sail {
	int m_width;
	int m_height;
	int m_byte_pixel;
	int m_color_mode;
	int m_flag_empty;
	unsigned char* m_frame_buf;
	bool m_sailstarted;

	char* m_execConfigName;
	int m_nwID;

	sail *sageInf;

	int m_flag_notinit;
	char* m_output_addr;
	int m_output_port;

	bool m_audioOn;				// audio on/off flag
#if defined (SAGE_AUDIO)
	sageAudioMode m_audioMode;	// audio mode : capture, play, read, write
	sageSampleFmt m_sampleFmt;	// audio sampling format : float, short, char, unsigned char
#endif
	int  m_audioPort;				// audio port number
	int  m_audioDeviceNum;		// device number
	long m_samplingRate;			// audio sampling rate : default-44100
	int  m_channels;				// number of audio channel
	int  m_framePerBuffer;		// audio frames per buffer
	int m_abuffsize;

	void SetZero(void);
	int sailInit(void);

public :

	C_Output_sail ();
	virtual ~C_Output_sail ();

	int init(int width, int height, int color_mode,char* output_addr, int output_port);
	void setSailEnv(char* execConfigName, int nwID);
	int push_data(unsigned char* buf , int buf_len);
	int push_audiodata(unsigned char* buf, int buf_len);
	void setAudioOn(bool on);
	int init(int size);
	int initAudioCaptureMode();
	void shutdown();

};



#endif
